package Test;

import java.util.Arrays;
import java.util.Scanner;

public class Main03 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int T = input.nextInt();
        int[] arr = new int[T];
        for (int i = 0; i < T; i++) {
            int n = input.nextInt();
            int x = input.nextInt();
            int[] a = new int[n];
            int sum = 0;
            for (int j = 0; j < n; j++) {
                a[j] = input.nextInt();
                sum += a[j];
            }
            int scores = n * x;
            Arrays.sort(a);
            arr[i] = function(a, sum, scores);
        }
        input.close();
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }

    }

    public static int function(int[] arr, int sum, int scores) {
        if (sum >= scores)
            return 0;
        else {
            int distance = scores - sum;
            int m = 0;
            while (distance > 0) {
                distance -= (100 - arr[m]);
                ++m;
            }
            return m;
        }
    }
}
